package com.hy.study;

import com.hy.study.config.JdbcConfig;
import com.hy.study.config.PersonConfig;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ImportResource;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * @author huyong
 * @date 2024 年 01 月 05 日 10:45: 47
 */
@SpringBootApplication
@ServletComponentScan// 扫描servlet filter  listener的实现
@EnableAsync // 开启异步
@EnableConfigurationProperties({PersonConfig.class, JdbcConfig.class})// 开启使用ConfigurationProperties 加载配置 配置加载读取自定义配置类
@ImportResource(locations = {"applicationContext.xml"})// 通过spring的配置文件加载一个bean
@EnableCaching// 启用缓存
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 60)// 开启redis session共享 1分钟失效
@EnableRetry // 开启调用第三方接口重试功能
public class ApplicationStart {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(ApplicationStart.class);
        springApplication.setBannerMode(Banner.Mode.OFF);// 关闭 Banner的输出
        springApplication.run(args);
    }

}
